#ifndef SEARCHPANEL_H
#define SEARCHPANEL_H

#include <QWidget>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>

class CodeEditor;

class SearchPanel : public QWidget
{
    Q_OBJECT
public:
    explicit SearchPanel(QWidget *parent = 0);
    ~SearchPanel();
    void setEditor(CodeEditor * aEditor);
    void setFindFocus();
signals:
    //void findTextChanged(QString aNewText);
    void onHide();
public slots:
    void onFindTextChanged(QString aNewText);
    void onForwardPressed();
    void onBackwardPressed();
    void onReplaceAllPressed();
    //void onReplaceInSelectionPressed();
    void onDonePressed();
private:
    QLineEdit * m_findEdit;
    QLineEdit * m_replaceEdit;
    QLabel * m_searchForLabel;
    QLabel * m_replaceWithLabel;
    QPushButton * m_forwardButton;
    QPushButton * m_backwardButton;
    QPushButton * m_replaceAllButton;
    //QPushButton * m_replaceInSelectionButton;
    QPushButton * m_doneButton;
    CodeEditor * m_editor;

    void keyPressEvent(QKeyEvent *e);
    void hideEvent (QHideEvent * event);
};

#endif // SEARCHPANEL_H
